package lzy.impl.smallspring.context.support;

import lzy.impl.smallspring.beans.factory.support.DefaultBeanFactory;
import lzy.impl.smallspring.beans.factory.support.XmlBeanDefinitionReader;

/**
 * 还需要找到这个抽象类的意义
 */
public abstract class AbstractXmlApplicationContext extends AbstractRefreshableApplicationContext {
    @Override
    protected void loadBeanDefinition(DefaultBeanFactory factory) {
        XmlBeanDefinitionReader beanDefinitionReader = new XmlBeanDefinitionReader(factory, this);
        for (String configLocation : getConfigLocations()) {
            beanDefinitionReader.loadBeanDefinitions(configLocation);
        }
    }

    /**
     * @return 当前这个ctx能找到的所有resource
     */
    protected abstract String[] getConfigLocations();
}
